package com.xbongbong.saas.enums;

import com.xbongbong.i18n.util.I18nMessageUtil;
import lombok.Getter;


/**
 * @author 余乾
 * @version v1.0
 * @date 2020/8/31 11:30
 * @since v1.0
 */
@Getter
public enum CustomerStatementProductEnum {
    PRODUCT(SelectProductEnum.PRODUCT.getAttr(),SelectProductEnum.PRODUCT.getSaasAttr(),SelectProductEnum.PRODUCT.getI18nAttrName(),SelectProductEnum.PRODUCT.getFieldType(),SetTypeEnum.DISABLE_ALL.getCode(),0,0,ShowTypeEnum.ALL.getCode(),1,1),
//    PRODUCT_NAME(SelectProductEnum.PRODUCT_NAME.getAttr(),SelectProductEnum.PRODUCT_NAME.getSaasAttr(),SelectProductEnum.PRODUCT_NAME.getI18nAttrName(),SelectProductEnum.PRODUCT_NAME.getFieldType(),SetTypeEnum.DISABLE_ALL.getCode(),0,0,ShowTypeEnum.ALL.getCode(),1,1),
//    PRODUCT_NO(SelectProductEnum.PRODUCT_NO.getAttr(),SelectProductEnum.PRODUCT_NO.getSaasAttr(),SelectProductEnum.PRODUCT_NO.getI18nAttrName(),SelectProductEnum.PRODUCT_NO.getFieldType(),SetTypeEnum.DISABLE_ALL.getCode(),0,0,ShowTypeEnum.ALL.getCode(),1,1),
//    SPECIFICATION(SelectProductEnum.SPECIFICATION.getAttr(),SelectProductEnum.SPECIFICATION.getSaasAttr(),SelectProductEnum.SPECIFICATION.getI18nAttrName(),SelectProductEnum.SPECIFICATION.getFieldType(),SetTypeEnum.DISABLE_ALL.getCode(),0,0,ShowTypeEnum.ALL.getCode(),1,1),
    SELLING_PRICE(SelectProductEnum.SELLING_PRICE.getAttr(),SelectProductEnum.SELLING_PRICE.getSaasAttr(),SelectProductEnum.SELLING_PRICE.getI18nAttrName(),SelectProductEnum.SELLING_PRICE.getFieldType(),SetTypeEnum.DISABLE_ALL.getCode(),0,0,ShowTypeEnum.ALL.getCode(),1,0),
    NUM(SelectProductEnum.NUM.getAttr(),SelectProductEnum.NUM.getSaasAttr(),"enum.contractOutstockProduct.attrName.num",SelectProductEnum.NUM.getFieldType(),SetTypeEnum.DISABLE_ALL.getCode(),0,0,ShowTypeEnum.ALL.getCode(),1,1),
    SUBTOTAL(SelectProductEnum.SUBTOTAL.getAttr(),SelectProductEnum.SUBTOTAL.getSaasAttr(),"enum.contractOutstockProduct.attrName.subtotal",SelectProductEnum.SUBTOTAL.getFieldType(),SetTypeEnum.DISABLE_ALL.getCode(),0,0,ShowTypeEnum.ALL.getCode(),1,0),
    ;

    /**
     * 英文名称
     */
    private String attr;
    /**
     * 英文名称
     */
    private String saasAttr;
    /**
     * 中文名称
     */
    private String attrName;
    /**
     * 字段类型，详见
     */
    private Integer fieldType;
    /**
     * 重命名、判重、启用必填等权限
     */
    private Integer setType;
    /**
     * 模板设计阶段字段是否允许编辑
     * 1：允许编辑
     * 0：不允许编辑
     */
    private Integer designEditable;
    /**
     * 字段是否显示在模板设计界面
     * 1：不显示
     * 0：显示
     */
    private Integer editHide;
    /**
     * 字段在各个界面（新建、编辑、列表、详情）的展现形式
     */
    private Integer showType;
    /**
     * 字段在各个界面是否可见(启用)
     * 1：可见
     * 0：不可见
     * 注：字段在具体页面的可见性需要用属性和showType联合判断，在visible=1的情况下判断showType
     */
    private Integer visible;
    /**
     * 字段是否必填
     * 1：必填
     * 0：不必填
     */
    private Integer required;

    CustomerStatementProductEnum(String attr, String saasAttr, String attrName, Integer fieldType, Integer setType, Integer designEditable, Integer editHide, Integer showType, Integer visible, Integer required) {
        this.attr = attr;
        this.saasAttr = saasAttr;
        this.attrName = attrName;
        this.fieldType = fieldType;
        this.setType = setType;
        this.designEditable = designEditable;
        this.editHide = editHide;
        this.showType = showType;
        this.visible = visible;
        this.required = required;
    }

    public String getAttrName() {
        return I18nMessageUtil.getMessage(attrName);
    }
}
